<?php

/**
 * Registration form base class.
 *
 * @package    wifilez
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseRegistrationForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'registration_id'   => new sfWidgetFormInputHidden(),
      'account_id'        => new sfWidgetFormPropelChoice(array('model' => 'Account', 'add_empty' => false)),
      'invoice_id'        => new sfWidgetFormInput(),
      'product_id'        => new sfWidgetFormPropelChoice(array('model' => 'Product', 'add_empty' => true)),
      'quantity'          => new sfWidgetFormInput(),
      'esd_tries'         => new sfWidgetFormInput(),
      'esd_expire'        => new sfWidgetFormDate(),
      'order_date'        => new sfWidgetFormDate(),
      'vendor_id'         => new sfWidgetFormInput(),
      'vendor_invoice_id' => new sfWidgetFormInput(),
      'collection_used'   => new sfWidgetFormInput(),
      'regcode'           => new sfWidgetFormInput(),
      'force_install'     => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'registration_id'   => new sfValidatorPropelChoice(array('model' => 'Registration', 'column' => 'registration_id', 'required' => false)),
      'account_id'        => new sfValidatorPropelChoice(array('model' => 'Account', 'column' => 'account_id')),
      'invoice_id'        => new sfValidatorInteger(array('required' => false)),
      'product_id'        => new sfValidatorPropelChoice(array('model' => 'Product', 'column' => 'product_id', 'required' => false)),
      'quantity'          => new sfValidatorInteger(array('required' => false)),
      'esd_tries'         => new sfValidatorInteger(array('required' => false)),
      'esd_expire'        => new sfValidatorDate(array('required' => false)),
      'order_date'        => new sfValidatorDate(array('required' => false)),
      'vendor_id'         => new sfValidatorInteger(array('required' => false)),
      'vendor_invoice_id' => new sfValidatorString(array('max_length' => 64, 'required' => false)),
      'collection_used'   => new sfValidatorInteger(array('required' => false)),
      'regcode'           => new sfValidatorString(array('max_length' => 32, 'required' => false)),
      'force_install'     => new sfValidatorInteger(),
    ));

    $this->widgetSchema->setNameFormat('registration[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Registration';
  }


}
